package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import service.majorunit.MajorunitService;
import util.returnvo.IndexReturnVO;

public class IndexContoller extends MultiActionController{
	
	private MajorunitService majorunitService;
	
	public void setMajorunitService(MajorunitService majorunitService) {
		this.majorunitService = majorunitService;
	}

	/**
	 * MajorunitService의 getIndexReturnVO(member_no) 호출. member_no가 String인 것에 개의치 말고 세션 값을 그대로 넣는다.
	 */
	public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception{
		IndexReturnVO indexReturn=majorunitService.getIndexReturnVO((String)request.getSession().getAttribute("member_no"));
		return new ModelAndView("index/index", "indexReturn", indexReturn);
	}
}
